

<template>
    <div style="margin-left:20px">
        <Button type="primary" @click="newsCate">新闻分类</Button>
        <Button type="primary" @click="uploadCate">上传分类</Button>
        <hr style="margin-top:10px;color:#ccc">
        <Tree :data="treeData" @on-select-change="onSelectChange"></Tree>
        <Button type="info" @click="addChildNode">添加子节点</Button>
        <Button type="success" @click="addRootNode">添加根节点</Button>
        <Button type="success" @click="removeRootNode">删除节点</Button>
        <Button type="info" @click="updataNode">修改节点</Button>
        <Modal v-model="modal" title="节点操作">
            <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="100" style="margin-right:50px">
                <FormItem label="节点名" prop="title">
                    <Input v-model="formValidate.title"  placeholder="请输入节点名"></Input>
                </FormItem>
                <FormItem>
                    <Button type="primary" @click="handleSubmit('formValidate')">提交</Button>
                    <Button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</Button>
                </FormItem>
            </Form>
        </Modal>
    </div>
</template>
<script>
	import cateBase from '../base/cateBase'
	export default {
		mixins:[cateBase],
		data () {
			return {
				type:1
			}
		},
        methods:{
			newsCate(){
                this.type=1;
				this.getTreeData()
            },
			uploadCate(){
				this.type=2;
				this.getTreeData()
            }
        }
	}
</script>
<style>
    .ivu-modal-footer{
        display: none;
    }
    .active{
        background: dodgerblue;
        color:white
    }
</style>